﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed
#pragma once

#include "GcmpModelInterface.h"
#include "IEvent.h"

namespace gcmp
{
    class ISelection;
    class ISelectionChangeEventHandler;

    /// \brief 选择集变化事件
    ///
    /// 选择集数据发现变化，会发送选择集变化事件
    class GCMP_MODEL_INTERFACE_EXPORT ISelectionChangeEvent : public IEvent
    {
        DEFINE_CAST_DERIVED(gcmp::ISelectionChangeEvent, gcmp::IEvent);
    public:
        /// \brief 添加选择集变化事件处理者
        /// \param pHandler 选择集变化事件处理者
        /// \return 返回true表示添加成功，否则表示失败
        virtual bool Add(ISelectionChangeEventHandler* pHandler) = 0;

        /// \brief 删除择集变化事件处理者，仅从容器中删除
        /// \param pHandler 择集变化事件处理者
        /// \return 返回true表示删除成功，否则表示失败
        virtual bool Delete(ISelectionChangeEventHandler* pHandler) = 0;

        /// \brief 得到发送者对象
        /// \return 发送者对象
        virtual ISelection* GetSender() const = 0;
    };
}


